package com.ruoyi.web.controller.statistics.college;

import java.util.List;
import javax.servlet.http.HttpServletResponse;

import com.ruoyi.system.domain.college.Statistics.PlatformConstructionStatistics;
import com.ruoyi.system.service.college.IPlatformConstructionStatisticsService;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;

/**
 * 平台建设统计Controller
 * 
 * @author ruoyi
 * @date 2025-11-24
 */
@RestController
@RequestMapping("/college/platformConstruction")
public class PlatformConstructionStatisticsController extends BaseController
{
    @Autowired
    private IPlatformConstructionStatisticsService platformConstructionStatisticsService;

    /**
     * 查询平台建设统计列表
     */
    @GetMapping("/list")
    public TableDataInfo list(PlatformConstructionStatistics platformConstructionStatistics)
    {
        startPage();
        List<PlatformConstructionStatistics> list = platformConstructionStatisticsService.selectPlatformConstructionStatisticsList(platformConstructionStatistics);
        return getDataTable(list);
    }

    /**
     * 导出平台建设统计列表
     */
    @Log(title = "平台建设统计", businessType = BusinessType.EXPORT)
    @PostMapping("/export")
    public void export(HttpServletResponse response, PlatformConstructionStatistics platformConstructionStatistics)
    {
        List<PlatformConstructionStatistics> list = platformConstructionStatisticsService.selectPlatformConstructionStatisticsList(platformConstructionStatistics);
        ExcelUtil<PlatformConstructionStatistics> util = new ExcelUtil<PlatformConstructionStatistics>(PlatformConstructionStatistics.class);
        util.exportExcel(response, list, "平台建设统计数据");
    }

    /**
     * 获取平台建设统计详细信息
     */
    @GetMapping(value = "/{id}")
    public AjaxResult getInfo(@PathVariable("id") Integer id)
    {
        return success(platformConstructionStatisticsService.selectPlatformConstructionStatisticsById(id));
    }

    /**
     * 新增平台建设统计
     */
    @Log(title = "平台建设统计", businessType = BusinessType.INSERT)
    @PostMapping
    public AjaxResult add(@RequestBody PlatformConstructionStatistics platformConstructionStatistics)
    {
        return toAjax(platformConstructionStatisticsService.insertPlatformConstructionStatistics(platformConstructionStatistics));
    }

    /**
     * 修改平台建设统计
     */
    @Log(title = "平台建设统计", businessType = BusinessType.UPDATE)
    @PutMapping
    public AjaxResult edit(@RequestBody PlatformConstructionStatistics platformConstructionStatistics)
    {
        return toAjax(platformConstructionStatisticsService.updatePlatformConstructionStatistics(platformConstructionStatistics));
    }

    /**
     * 删除平台建设统计
     */
    @Log(title = "平台建设统计", businessType = BusinessType.DELETE)
	@DeleteMapping("/{ids}")
    public AjaxResult remove(@PathVariable Integer[] ids)
    {
        return toAjax(platformConstructionStatisticsService.deletePlatformConstructionStatisticsByIds(ids));
    }
}
